<!DOCTYPE html>
<html lang="en"  xmlns:th="http://www.thymeleaf.org">
<head>
    <div th:replace="~{/fragment/header :: header}"></div>
    <div th:replace="~{/fragment/header :: header-css}"></div>
    <div th:replace="~{/fragment/header :: header-nav}"></div>
</head>
<body>
<form th:action="@{/vehicle/save}" th:object="${vehicle}" method="post" enctype="multipart/form-data">
    <input type="hidden" th:field="*{id}">

    <br>

    <div class="input-group mb-3">
        <span class="input-group-text">车牌号</span>
        <input type="text" th:field="*{licencePlate}" class="form-control">
    </div>

    <div class="input-group mb-3">
        <span class="input-group-text">车牌图片</span><br>
        <img id="piUrl" alt="车牌图片" th:src="*{piUrl}" class="img-fluid"><br>
        <input type="file" name="file">
    </div>


    <div class="form-group">
        <span class="input-group-text" for="isActive">出入场标识</span>
        <select class="form-control" name="isActive" id="isActive">
            <option value="true">入场</option>
            <option value="false">出场</option>
        </select>
    </div>

    <div class="form-group">
        <span class="input-group-text" for="parkingLotId">停车场</span>
        <select class="form-control" name="parkingLotId" id="parkingLotId">
            <option th:each="parkingLot:${parkingLots}" th:value="${parkingLot.id}" th:text="${parkingLot.name}"></option>
        </select>
    </div>


    <input class="btn btn-primary" type="submit" th:value="提交">
    <a th:href="@{/vehicle/list}" class="btn btn-secondary">返回</a>

</form>



<div th:replace="~{/fragment/header :: header-js}"></div>
<div th:replace="~{/fragment/footer :: footer}"></div>
</body>
</html>